#include <stdint.h>
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
#include <poll.h>

static void* write01(void *ptr) {
	int fd = open("/dev/t01", O_RDWR, O_NONBLOCK);
	while(1){
		char *buf = "kfifo_from_user - puts some data from user space into the fifo;";
		write(fd, buf, strlen(buf));
		sleep(1);
	}
	close(fd);
	return NULL;
}

int main() {
	pthread_t thread2;
	pthread_create(&thread2, NULL, write01, NULL);
	pthread_join(thread2, NULL);
	printf("main exit\n");
	return EXIT_SUCCESS;
}

